package com.bdqn.controller;

import com.alibaba.fastjson.JSON;
import com.bdqn.service.ICourseDirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 忍
 * @title: CourseDirectionController
 * @projectName Teaching
 * @description: TODO
 * @date 2019/5/2323:12
 */
@RestController
public class CourseDirectionController {
    @Autowired
    ICourseDirectionService courseDirectionService;
    @GetMapping("/list/{id}")
    public String findCourseByCourseType(@PathVariable int id,Integer level){
//        return JSON.toJSONString(courseDirectionService.getCourseDirectionById(id,level));
        return null;
    }

//    @GetMapping("/list/{id}")
//    public String findCourseByCourseTypeLevel(@PathVariable int id,
//                                              @RequestParam(required =false) String level,@RequestParam(required = false) String sort,
//                                              @RequestParam(required = false) String unlearn,@RequestParam(required = false) String page ){
//        return JSON.toJSONString(courseDirectionService.getCourseDirectionById(id));
//    }
    @GetMapping("/directs/{id}")
    public ModelAndView findCourseDirection(@PathVariable int id){
        ModelAndView mav = new ModelAndView();
        mav.setViewName("course");
        return mav;
    }
    @GetMapping("/course}")
    public ModelAndView findCourseDirectionLevel(@PathVariable int id){
        ModelAndView mav = new ModelAndView();
        mav.setViewName("course");
        return mav;
    }
    @GetMapping("/test")
    public void test(@RequestParam(required = false) String id,
                       @RequestParam(required = false) String name){
        System.out.println(id);
        System.out.println(name);

    }
}
